home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / News Stacks / Jan '90AMUG News™.cpt / Jan '90AMUG News™ / card_15647.txt < prev    next >
Text File  |  1990-01-21  |  2KB  |  74 lines

  1. -- card: 15647 from stack: in
  2. -- bmap block id: 15956
  3. -- flags: 0000
  4. -- background id: 2135
  5. -- name: Diamond
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 00
  10. -- high flags: 0000
  11. -- rect: left=11 top=60 right=321 bottom=261
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 2
  16. -- text size: 10
  17. -- style flags: 0
  18. -- line height: 13
  19. -- part name: 
  20.  
  21.  
  22. -- part 2 (field)
  23. -- low flags: 00
  24. -- high flags: 0000
  25. -- rect: left=262 top=60 right=334 bottom=508
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 0
  29. -- font id: 2
  30. -- text size: 10
  31. -- style flags: 0
  32. -- line height: 13
  33. -- part name: 
  34.  
  35.  
  36. -- part contents for background part 1
  37. ----- text -----
  38. 21
  39.  
  40. -- part contents for card part 2
  41. ----- text -----
  42. of the object.  The object's name is distin-guished from other variables by the a capital T (for Type) in front.  Object Pascal doesn't require you to do this, but using this convention makes it easier to keep track of what are object types and what are not.
  43. Example 1:  A window object declaration in Object Pascal.
  44. TWindow = object(TObject)
  45. wPtr : WindowPtr;
  46. function Open : Boolean;
  47. procedure Draw;
  48. procedure Close;
  49. end;
  50. In order to use a TWindow object, an instance of the 
  51. TWindow type 
  52. (alias class in 
  53. other OOP languages)
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. -- part contents for card part 1
  71. ----- text -----
  72. to a window, it will use the data it contains to draw the contents of the window.  If I tell it to close, it will doing whatever it needs to do to close.  In fact, a pure OOP language will not allow you to access the data except through messages.  Even though Object Pascal is not this strict, it is wise to show self-restraint and provide access procedures anyway.
  73.     An object definition in Object Pascal is an extension of the record type (see example 1 for the definition of a simple window object).  Notice the use of the keyword "object" to tell the compiler that TWindow is an object and not a record.  Just like a record, an object contains fields (called instance variables in OOPs lingo).  However, an object also contains procedures or functions (called instance methods or more simply methods) which define the behavior
  74.